package eu.robico.simulator.simulatorinterface;

import eu.robico.simulator.simulatorinterface.communication.Protocol.Trigger;

public class MainController 
{
	//Singleton implementation
	private MainController() { };
	private static MainController instance = new MainController();
	public static MainController getInstance()
	{
		return instance;
	}
	
	private SimulatorInterface simulatorInterface;
	
	void setSimulatorInterface(SimulatorInterface simulatorInterface)
	{
		this.simulatorInterface = simulatorInterface;
	}
	
	void connect(String ip, short port)
	{
		this.simulatorInterface.connect(ip, port);
	}
	
	public void sendTrigger(Trigger trigger)
	{
		this.simulatorInterface.sendTrigger(trigger);
	}
	
	void disconnect()
	{
		this.simulatorInterface.disconnect();
	}

	//TODO: do something with this or just remove it
	@SuppressWarnings("unused")
	private ApplicationWindow applicationWindow;
	
	void setApplicationWindow(ApplicationWindow applicationWindow)
	{
		this.applicationWindow = applicationWindow;
	}
	
	public RobotStatus getRobotStatusCopy()
	{
		return this.simulatorInterface.getRobotStatusCopy();
	}
	
	public SimulatorStatus getSimulatorStatusCopy()
	{
		return this.simulatorInterface.getSimulatorStatusCopy();
	}
}
